package com.example.annotation

import android.os.Bundle
import android.view.View
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.example.annotation.reflect.InjectUtils
import com.example.annotation.reflect.OnClick
import com.example.annotation.reflect.OnLongClick
import com.example.libannotation.BindView

class MainActivity : AppCompatActivity() {
    @BindView(R.id.mTVTest)
    lateinit var mTVTest:TextView

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        JettButterknife.bind(this)
        InjectUtils.inject(this)
        mTVTest.text = "123456"
    }
    @OnClick(R.id.mTVTest)
    fun click(view:View){
        Toast.makeText(view.context,"自定义点击绑定",Toast.LENGTH_SHORT).show()
    }
    @OnLongClick(R.id.mTVTest)
    fun longClick(view:View):Boolean{
        Toast.makeText(view.context,"自定义长按绑定",Toast.LENGTH_SHORT).show()
        return false
    }
}